package test;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		
		Queue<String> q = new ArrayDeque<String>();
        List<String> arr = new ArrayList<String>();
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            String str = in.next();
            if(str.equals("!!!!!"))
                break;
            if(!arr.contains(str)){
            	arr.add(str);
            }
        }
        System.out.println(arr.size());
        Collections.sort(arr);
        if(arr.size()>10)
        	q.addAll(arr.subList(0, 10));
        else
        	q.addAll(arr);
        for (String queue : q) {
			System.out.println(queue);
		}
	}
}
